/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.deployment.relatorio;

import br.com.deployment.daoImpl.NotaryOfficeDAOImpl;
import br.com.deployment.daoImpl.QuestionnaireResponseDAOImpl;
import br.com.deployment.entities.NotaryOffice;
import br.com.deployment.entities.QuestionnaireResponse;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.primefaces.event.SelectEvent;

/**
 *
 * @author ely
 */
@ManagedBean
@SessionScoped
public class ManagerRelEdictNotary {
    
    @EJB
    QuestionnaireResponseDAOImpl quesReponseService;
    
    @EJB
    NotaryOfficeDAOImpl notaryOfficeService;
    
    private QuestionnaireResponse quesResponse;
    private NotaryOffice notaryOffice;
    private List<QuestionnaireResponse> lstQuesReponse;
    
    public ManagerRelEdictNotary(){
        
    }
    
    public void  searchQuestionnaireReponse(){
       lstQuesReponse = quesReponseService.findQNotaryOffice(notaryOffice);
      
    }
    
    public void handleSelectNotary(SelectEvent event) {
        NotaryOffice notary = (NotaryOffice) event.getObject();
        notaryOffice = notaryOfficeService.find(notary.getId());
        System.err.println("HANDLESELECT NOTARY " + notaryOffice);

    }
    
    public List<QuestionnaireResponse> getLstQuesReponse() {
        return lstQuesReponse;
    }

    public void setLstQuesReponse(List<QuestionnaireResponse> lstQuesReponse) {
        this.lstQuesReponse = lstQuesReponse;
    }

    public NotaryOffice getNotaryOffice() {
        return notaryOffice;
    }

    public void setNotaryOffice(NotaryOffice notaryOffice) {
        this.notaryOffice = notaryOffice;
    }
    
    
    
}
